package com.wechatmall.api.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import lombok.Builder;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 实体类
 * </p>
 *
 * @author zpc
 * @since 2025-09-24 02:24:13
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(name = "Products", description = "实体")
public class Products implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "主键ID", example = "1", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Integer id;

    @Schema(description = "产品名称", example = "示例值")
    @TableField("`name`")
    private String name;

    @Schema(description = "描述", example = "示例值")
    @TableField("`description`")
    private String description;

    @Schema(description = "细节", example = "示例值")
    private String detailHtml;

    @Schema(description = "价格", example = "1")
    private Integer price;

    @Schema(description = "原价", example = "1")
    private Integer originalPrice;

    @Schema(description = "库存", example = "1")
    private Integer stock;

    private Integer salesCount;

    @Schema(description = "单位", example = "示例值")
    private String unit;

    @Schema(description = "主要图片URL", example = "示例值")
    private String mainImageUrl;

    @Schema(description = "图片url", example = "示例值")
    private String imageUrls;

    @Schema(description = "分类ID", example = "1")
    private Integer categoryId;

    @Schema(description = "商家ID", example = "示例值")
    private String merchantId;

    @Schema(description = "排序", example = "1")
    private Integer sortOrder;

    @Schema(description = "是否启用", example = "1")
    private Integer isActive;

    private Integer isRecommended;

    private Integer isNew;

    private Integer isHot;

    @Schema(description = "创建时间", example = "2024-01-01T12:00:00", accessMode = Schema.AccessMode.READ_ONLY)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createdAt;

    @Schema(description = "更新时间", example = "2024-01-01T12:00:00", accessMode = Schema.AccessMode.READ_ONLY)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updatedAt;
}